<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>vue组件化的基本使用</title>
  </head>
  <body>
    <div id="app">
      <!-- <h3>我是标题</h3>
      <h3>我是内容</h3>
      <h3>woshi haha ha</h3> -->
      <!-- 3。使用组件 -->
      <my-cpn></my-cpn>
      <my-cpn></my-cpn>
    </div>
    <script src="../vue.js"></script>
    <script>
      //1.创建组件构造器
      const cpnC = Vue.extend({
        template: `
        <div>
          <h2>我是内容吗？</h2>
          <h2>我是标题</h2>
          <h3>我是哈哈</h3>
        </div>`,
      });
      //2.注册组件
      // Vue.component("组件的标签名");
      Vue.component("my-cpn", cpnC);
      const app = new Vue({
        el: "#app",
        data: {
          message: "hello",
        },
      });
    </script>
  </body>
</html>
